package com.ruoyi.deeplearn.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.deeplearn.domain.MarkTagVo;
import com.ruoyi.deeplearn.service.DatasetMarkV2Service;
import com.ruoyi.deeplearn.service.IDeepDatasetMarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/deeplearn/mark")
public class DataserMarkV2Controller extends BaseController {
    @Autowired
    private DatasetMarkV2Service datasetMarkV2Service;

//    @PreAuthorize("@ss.hasPermi('deeplearn:mark:add')")
    @Log(title = "标记", businessType = BusinessType.INSERT)
    @PostMapping("/save/mark/{fileId}")
    public AjaxResult saveMark(@PathVariable("fileId")Long fileId,
                               @RequestBody List<MarkTagVo> markTagVos)
    {
        int count = datasetMarkV2Service.saveMark(fileId,markTagVos);
        return toAjax(count);
    }
}
